------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/thomascrossley/Dropbox/complete 2014/cl - are the unemployed credit constrainted/s
> tata/archive prep/PUMF/cl_credit.log
  log type:  text
 opened on:  26 Jun 2015, 11:42:45

. *********************************
. * cl_credit.do
. * Empirical Analsysis for: * Crossley, T.F., and H. Low, ìJob Loss, Credit Constraints and Consumpti
> on Growth.î Review of Economics and Statistics, 96(5):876-884 (December, 2014.) 
. * Contact: tfcrossley@gmail.com or tcross@esex.ac.uk
. * This program does the analysis for the figures and tables
. * cl_data.do previously used to create cl2014.dta;
. * this program does not call any other programs
. **************************************
. set more 1

. #delimit;
delimiter now ;
. ***************************************;
. **************************************************;
. * Data and variable list;
. use cl2014.dta, replace;

. des,s;

Contains data from cl2014.dta
  obs:         2,370                          
 vars:            65                          26 Jun 2015 11:41
 size:       374,460                          
Sorted by: 

. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       SEQID |      2,370    8554.222    5534.083          3      19185
     rqreas1 |        116    5.301724      2.4396          1          8
      cempl1 |      2,370    .5700422    .4951743          0          1
    i1spell1 |      2,370    2.349789     .999583          1          4
    chhsize1 |      2,366    2.873626    1.348904          1          9
-------------+---------------------------------------------------------
    cspouse1 |      2,365    .7247357    .4467418          0          1
    cparnts1 |      2,365           0           0          0          0
    cothers1 |      2,365           0           0          0          0
      cxtot1 |      2,252    1703.674    934.9556        150       8200
      cpinc1 |      2,272     1604.11    1037.431          0       9995
-------------+---------------------------------------------------------
     chhinc1 |      2,190    2253.281     1319.86          0       9000
    ownhome1 |      2,366    .6301775    .4828585          0          1
    mrtgage1 |      2,356    .4329372    .4955874          0          1
    anyasst1 |      2,343    .5019206     .500103          0          1
    amtasst1 |      2,144    8565.039    18464.69          0      90000
-------------+---------------------------------------------------------
     asfall1 |      2,351    .2862612    .4521091          0          1
    aamtfll1 |      2,257    1166.715    3811.284          0      70000
     asrise1 |      2,354    .1648258    .3711021          0          1
    aamtrse1 |      2,231    246.8758    983.4635          0       9007
    amtdebt1 |      2,278    3411.493    7022.202          0      50000
-------------+---------------------------------------------------------
     dtfall1 |      2,356    .2814092    .4497821          0          1
    damtfll1 |      2,265    676.1912    2658.036          0      60000
     dtrise1 |      2,362    .1875529    .3904374          0          1
    damtrse1 |      2,300    326.2483    1086.271          0       9000
     scrdta1 |      2,361    .2460822    .4308182          0          1
-------------+---------------------------------------------------------
     scrdtd1 |        578    .2404844    .4277478          0          1
     scrdtf1 |        433    .9515012    .2150663          0          1
     scrdtr1 |         48    .8333333    .9527861          0          3
     scrdtt1 |      1,756    .1127563    .3163847          0          1
    cldbrrw1 |      2,301    .7409822    .4381906          0          1
-------------+---------------------------------------------------------
    wldbrrw1 |        586    .1313993    .3381252          0          1
     hrdshp1 |      2,366    .5604396    .4964385          0          1
    rsp_emp1 |      2,280    .4627193    .4987176          0          1
     vismin1 |      2,347    .2087772    .4065214          0          1
     W2RESP2 |      2,370           1           0          1          1
-------------+---------------------------------------------------------
    chhsize2 |      2,370    2.952321    1.345633          1         10
      cxtot2 |      2,255     1760.68    1091.533         40       9995
     chhinc2 |      2,161    2278.116    1384.928          0       9000
      cpinc2 |      1,921    1594.525    1107.927          0       9000
      rhhinc |      2,184    2153.847    1241.894          0       9000
-------------+---------------------------------------------------------
    welapsd1 |      2,370      36.412     3.34449   26.28564         44
    welapsd2 |      2,370    58.41586    3.604226   50.57141   66.71423
        quit |      2,370    .0493671     .216679          0          1
        fire |      2,370    .0295359    .1693387          0          1
         ill |      2,370    .0527426    .2235664          0          1
-------------+---------------------------------------------------------
        male |      2,370    .7080169    .4547705          0          1
         age |      2,370    39.32616     7.93358         26         55
         hgh |      2,367    .4148711    .4928039          0          1
      unicol |      2,367    .2374313    .4255987          0          1
         dch |      2,366    .5215554    .4996407          0          1
-------------+---------------------------------------------------------
   prim_earn |      2,370           1           0          1          1
      dhhass |      2,131   -977.2384    4116.862     -70000       9007
      rhhass |      1,984    8666.801    18066.15          0     120000
      dhhdeb |      2,202   -354.7693    2992.615     -60000       9000
      rhhdeb |      2,130     3573.95    7186.556          0      80000
-------------+---------------------------------------------------------
     ranyass |      1,984    .5665323    .4956786          0          1
     ranydeb |      2,130    .6037559    .4892311          0          1
      income |      2,184    2153.847    1241.894          0       9000
    r_assrat |      1,827    4.321063    10.50319          0   171.4286
    r_debrat |      1,968    2.128938    6.346715          0        150
-------------+---------------------------------------------------------
       r_net |      1,824    4962.861    19373.05     -80000     120000
    r_netrat |      1,702    2.094936    11.34663       -137   116.4286
      r_ass1 |      1,827    .4367816    .4961231          0          1
      r_deb1 |      1,968    .3602642     .480199          0          1
      cempl2 |      2,286    .5944882    .4910982          0          1

.  *************************************************;
. * LHS Variables;
. *Generate "would/could" variables;
. * note that these variables are asked in interview1;
. sum cldbrrw1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    cldbrrw1 |      2,301    .7409822    .4381906          0          1

. * case deletion;
. drop if cldbrrw1==.;
(69 observations deleted)

. tab cldbrrw1 wldbrrw1, mis row;

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

           |             QJ41    
  QJ40     |         0          1          . |     Total
-----------+---------------------------------+----------
         0 |       509         77         10 |       596 
           |     85.40      12.92       1.68 |    100.00 
-----------+---------------------------------+----------
         1 |         0          0      1,705 |     1,705 
           |      0.00       0.00     100.00 |    100.00 
-----------+---------------------------------+----------
     Total |       509         77      1,715 |     2,301 
           |     22.12       3.35      74.53 |    100.00 


. gen constrnd1=0 if cldbrrw1~=.;

. replace constrnd1=1 if (cldbrrw1==0 & wldbrrw1==1);
(77 real changes made)

. sum constrnd1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   constrnd1 |      2,301    .0334637    .1798832          0          1

. gen cantbrrw1=1-cldbrrw1;

. *Generate "SCF"  Variables,  
> * note that these variables refer to the period from the job loss to the first interview;
. rename scrdta1 applied;

. * case deletion;
. drop if applied==.;
(8 observations deleted)

. tab cempl1 applied, row mis;

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

           |       QJ34    
  QA16     |         0          1 |     Total
-----------+----------------------+----------
         0 |       776        203 |       979 
           |     79.26      20.74 |    100.00 
-----------+----------------------+----------
         1 |       953        361 |     1,314 
           |     72.53      27.47 |    100.00 
-----------+----------------------+----------
     Total |     1,729        564 |     2,293 
           |     75.40      24.60 |    100.00 


. rename scrdtd1 declined;

. rename scrdtf1 full_amt;

. gen nfa=1-full_amt;
(1,870 missing values generated)

. gen unsucc1=0 ;

. replace unsucc1=1 if  declined==1|nfa==1;
(151 real changes made)

. rename scrdtr1 gotlater;

. replace gotlater=0 if gotlater==3;
(6 real changes made)

. * high nonresponse so count nonresponse as no;
. replace gotlater=0 if gotlater==.&unsucc1==1;
(107 real changes made)

. replace unsucc1=0 if gotlater==1;
(21 real changes made)

. gen unsucc1b=unsucc1;

. replace unsucc1b=. if applied==0;
(1,729 real changes made, 1,729 to missing)

. rename scrdtt1 discouraged;

. gen discouraged2=discouraged;
(588 missing values generated)

. replace discouraged2=0 if applied==1;
(564 real changes made)

. gen unsucc2 = unsucc1;

. replace unsucc2=1 if discouraged2==1;
(191 real changes made)

. * Check item nonresponse;
. count;
  2,293

. sum cldbrrw1 wldbrrw1 applied unsucc1 unsucc2 cempl1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    cldbrrw1 |      2,293    .7409507    .4382083          0          1
    wldbrrw1 |        584    .1318493    .3386169          0          1
     applied |      2,293     .245966    .4307524          0          1
     unsucc1 |      2,293    .0566943     .231308          0          1
     unsucc2 |      2,293    .1399913    .3470537          0          1
-------------+---------------------------------------------------------
      cempl1 |      2,293    .5730484     .494743          0          1

. *exit;
. **************************************************;
. *TABLE 1: CREDIT MARKET ACCESS AND CREDIT CONSTRAINED
> 
> * employment status;
. label variable cempl1 "employed";

. label define cempl1 0 "not empl" 1 "empl." ;

. label values cempl1 cempl1;

. * would borrow/ could borrow;
. table cempl1 , row 
>               c(mean cantbrrw1 mean wldbrrw1 mean constrnd1 n SEQID) 
>               format(%9.3f);

--------------------------------------------------------------------------
 employed | mean(cantbr~1)  mean(wldbrrw1)  mean(constr~1)        N(SEQID)
----------+---------------------------------------------------------------
 not empl |          0.312           0.130           0.040             979
    empl. |          0.220           0.134           0.029           1,314
          | 
    Total |          0.259           0.132           0.034           2,293
--------------------------------------------------------------------------

. * SCF type questions;
. sum applied declined nfa gotlater;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     applied |      2,293     .245966    .4307524          0          1
    declined |        561    .2370766    .4256692          0          1
         nfa |        423    .0425532    .2020865          0          1
    gotlater |        151    .1390728     .347174          0          1

. sum unsucc1 discouraged discouraged2 unsucc2;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     unsucc1 |      2,293    .0566943     .231308          0          1
 discouraged |      1,705    .1120235    .3154878          0          1
discouraged2 |      2,269    .0841781    .2777159          0          1
     unsucc2 |      2,293    .1399913    .3470537          0          1

. *exit;
. ****************************************************************************;
. * FIGURE 1: CREDIT STATUS BY AGE;
. gen agecat=recode(age, 35,45,55);

. gen temp1= cantb;

. replace temp1=0 if constr==1;
(77 real changes made)

. gen temp2=unsucc2;

. replace temp2=0 if unsucc1==1;
(130 real changes made)

. #delimit;
delimiter now ;
. *graph bar (mean) unsucc1 (mean) temp2, stack over(agecat, relabel(1 "26-35" 2 "36-45" 3 "46-55")) b
> label(total, format(%6.2f))
>                                                                                       ylabel(0 .1 .2
>  .3 .4 .5) legend(off) scheme(s1mono) graphregion(fcolor(white) ifcolor(white))
>                                                                                        saving(cc_age
> 1, replace);
. #delimit;
delimiter now ;
. *graph bar (mean) constr (mean) temp1, stack over(cempl1, relabel( 1 "Not Empl." 2 "Empl.") ) over(a
> gecat, relabel(1 "26-35" 2 "36-45" 3 "46-55")) 
>                             ylabel(0 .1 .2 .3 .4 .5) legend(off) scheme(s1mono) graphregion(fcolor(w
> hite) ifcolor(white)) blabel(total, format(%6.2f))
>                              saving(cc_age2, replace) ;
. *gr combine cc_age1.gph cc_age2.gph, colfirst graphregion(fcolor(white) ifcolor(white)) saving(cc_ag
> e.gph,replace);
. *gr export cc_age.wmf, replace;
. drop temp1 temp2;

. *************************************************;
. * RHS VARIABLES FOR PROBITS (FOR TABLE 2);
. replace age=(age-40)/10;
(2,293 real changes made)

. sum age;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         age |      2,293   -.0746184    .7929727       -1.4        1.5

. gen age45=0;

. replace age45=(age-0.5) if age>0.5&age~=.;
(590 real changes made)

. macro define base="male age age45 hgh unicol cspouse1 dch vismin1";

. macro define extra="quit fire ill  ownhome1 mrtgage1 rsp_emp ranyass ranydeb ";

. sum $base $extra ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        male |      2,293    .7069341    .4552677          0          1
         age |      2,293   -.0746184    .7929727       -1.4        1.5
       age45 |      2,293    .1249455    .2576856          0          1
         hgh |      2,291    .4168485     .493145          0          1
      unicol |      2,291    .2370144     .425344          0          1
-------------+---------------------------------------------------------
    cspouse1 |      2,288    .7250874    .4465678          0          1
         dch |      2,289    .5224989    .4996027          0          1
     vismin1 |      2,273    .2098548    .4072944          0          1
        quit |      2,293    .0505887    .2192042          0          1
        fire |      2,293    .0296555     .169672          0          1
-------------+---------------------------------------------------------
         ill |      2,293    .0523332    .2227466          0          1
    ownhome1 |      2,289    .6299694     .482918          0          1
    mrtgage1 |      2,280    .4324561    .4955255          0          1
    rsp_emp1 |      2,206    .4660018    .4989559          0          1
     ranyass |      1,935    .5689922    .4953452          0          1
-------------+---------------------------------------------------------
     ranydeb |      2,080    .6052885    .4889062          0          1

. *************************************************;
. * TABLE 2: CHARACTERISTICS OF CREDIT CONSTRAINED;
. * COLUMN 1;
. dprobit cantbrrw1 $base $extra  cempl1;

Iteration 0:   log likelihood = -985.51842
Iteration 1:   log likelihood =  -902.7908
Iteration 2:   log likelihood =  -901.7736
Iteration 3:   log likelihood = -901.77245

Probit regression, reporting marginal effects           Number of obs =   1700
                                                        LR chi2(17)   = 167.49
                                                        Prob > chi2   = 0.0000
Log likelihood = -901.77245                             Pseudo R2     = 0.0850

------------------------------------------------------------------------------
cantbr~1 |      dF/dx   Std. Err.      z    P>|z|     x-bar  [    95% C.I.   ]
---------+--------------------------------------------------------------------
    male*|  -.0534571   .0264022    -2.07   0.038   .728235  -.105205  -.00171
     age |   .0405426   .0212881     1.90   0.057  -.094118  -.001181  .082266
   age45 |   -.145453   .0692837    -2.10   0.036   .120294  -.281247  -.00966
     hgh*|  -.0492778   .0245072    -1.99   0.046   .427059  -.097311 -.001245
  unicol*|  -.0647841   .0275582    -2.25   0.025   .232941  -.118797 -.010771
cspouse1*|  -.0251854   .0339121    -0.75   0.453   .709412  -.091652  .041281
     dch*|   .0249958   .0253447     0.98   0.325   .543529  -.024679   .07467
 vismin1*|    .059831    .027772     2.22   0.026   .206471   .005399  .114263
    quit*|  -.0593835   .0451466    -1.22   0.222   .048824  -.147869  .029102
    fire*|   .0960847   .0706913     1.45   0.146   .028235  -.042468  .234637
     ill*|  -.0456705   .0444652    -0.97   0.330   .051765  -.132821   .04148
ownhome1*|  -.2499514   .0375804    -6.72   0.000   .618824  -.323608 -.176295
mrtgage1*|   .1292157   .0346243     3.75   0.000   .430588   .061353  .197078
rsp_emp1*|  -.0192346   .0274005    -0.70   0.484   .448824  -.072939  .034469
 ranyass*|  -.1095573   .0227353    -4.86   0.000   .577059  -.154118 -.064997
 ranydeb*|   .0251759   .0223144     1.12   0.263   .623529   -.01856  .068911
  cempl1*|  -.1073308   .0223214    -4.85   0.000   .579412   -.15108 -.063582
---------+--------------------------------------------------------------------
  obs. P |   .2664706
 pred. P |   .2464007  (at x-bar)
------------------------------------------------------------------------------
(*) dF/dx is for discrete change of dummy variable from 0 to 1
    z and P>|z| correspond to the test of the underlying coefficient being 0

. *COLUMN 2;
. dprobit constrnd1 $base $extra  cempl1;

Iteration 0:   log likelihood =  -282.3193
Iteration 1:   log likelihood = -243.20503
Iteration 2:   log likelihood = -239.00113
Iteration 3:   log likelihood = -238.68034
Iteration 4:   log likelihood = -238.67512
Iteration 5:   log likelihood = -238.67512

Probit regression, reporting marginal effects           Number of obs =   1700
                                                        LR chi2(17)   =  87.29
                                                        Prob > chi2   = 0.0000
Log likelihood = -238.67512                             Pseudo R2     = 0.1546

------------------------------------------------------------------------------
constr~1 |      dF/dx   Std. Err.      z    P>|z|     x-bar  [    95% C.I.   ]
---------+--------------------------------------------------------------------
    male*|   .0056984   .0063298     0.85   0.395   .728235  -.006708  .018105
     age |   .0026467   .0057108     0.46   0.644  -.094118  -.008546   .01384
   age45 |  -.0368132   .0235833    -1.52   0.130   .120294  -.083036  .009409
     hgh*|  -.0124347   .0062733    -1.99   0.046   .427059   -.02473 -.000139
  unicol*|  -.0184632   .0059289    -2.63   0.009   .232941  -.030084 -.006843
cspouse1*|  -.0097145   .0105074    -1.00   0.316   .709412  -.030309   .01088
     dch*|   .0142446   .0070608     2.04   0.041   .543529   .000406  .028083
 vismin1*|   .0158634   .0091514     2.05   0.041   .206471  -.002073    .0338
    quit*|   .0124331    .017649     0.85   0.395   .048824  -.022158  .047024
    fire*|   .0434236   .0332564     1.97   0.048   .028235  -.021758  .108605
     ill*|   .0158138   .0182298     1.08   0.279   .051765  -.019916  .051544
ownhome1*|  -.0748625   .0263086    -3.62   0.000   .618824  -.126426 -.023299
mrtgage1*|    .025212   .0167359     1.59   0.112   .430588   -.00759  .058014
rsp_emp1*|  -.0009297   .0077346    -0.12   0.904   .448824  -.016089   .01423
 ranyass*|  -.0141942   .0068781    -2.21   0.027   .577059  -.027675 -.000713
 ranydeb*|   .0094522   .0060689     1.51   0.130   .623529  -.002443  .021347
  cempl1*|  -.0096078   .0064021    -1.57   0.117   .579412  -.022156   .00294
---------+--------------------------------------------------------------------
  obs. P |   .0394118
 pred. P |   .0194238  (at x-bar)
------------------------------------------------------------------------------
(*) dF/dx is for discrete change of dummy variable from 0 to 1
    z and P>|z| correspond to the test of the underlying coefficient being 0

. *COLUMN 3;
. dprobit unsucc2 $base $extra;

Iteration 0:   log likelihood = -699.24233
Iteration 1:   log likelihood =  -631.3392
Iteration 2:   log likelihood = -629.56452
Iteration 3:   log likelihood = -629.55611
Iteration 4:   log likelihood = -629.55611

Probit regression, reporting marginal effects           Number of obs =   1700
                                                        LR chi2(16)   = 139.37
                                                        Prob > chi2   = 0.0000
Log likelihood = -629.55611                             Pseudo R2     = 0.0997

------------------------------------------------------------------------------
 unsucc2 |      dF/dx   Std. Err.      z    P>|z|     x-bar  [    95% C.I.   ]
---------+--------------------------------------------------------------------
    male*|   .0081364   .0182279     0.44   0.659   .728235   -.02759  .043862
     age |  -.0179161   .0153851    -1.16   0.244  -.094118   -.04807  .012238
   age45 |  -.0407074    .054854    -0.74   0.459   .120294  -.148219  .066804
     hgh*|   .0017996   .0181548     0.10   0.921   .427059  -.033783  .037382
  unicol*|  -.0471046   .0193925    -2.22   0.026   .232941  -.085113 -.009096
cspouse1*|  -.0245372   .0253743    -0.99   0.320   .709412   -.07427  .025195
     dch*|   .0153953   .0183971     0.83   0.405   .543529  -.020662  .051453
 vismin1*|   .0396641   .0211455     1.99   0.047   .206471   -.00178  .081109
    quit*|  -.0020981   .0363513    -0.06   0.954   .048824  -.073345  .069149
    fire*|   .1019144   .0611391     1.98   0.047   .028235  -.017916  .221745
     ill*|   .0455121   .0406498     1.23   0.218   .051765   -.03416  .125184
ownhome1*|  -.1536857   .0320325    -5.14   0.000   .618824  -.216468 -.090903
mrtgage1*|   .0375702   .0276619     1.37   0.170   .430588  -.016646  .091786
rsp_emp1*|  -.0208816    .020327    -1.02   0.307   .448824  -.060722  .018959
 ranyass*|  -.0458396   .0169432    -2.75   0.006   .577059  -.079048 -.012631
 ranydeb*|   .0654692   .0156741     3.95   0.000   .623529   .034748   .09619
---------+--------------------------------------------------------------------
  obs. P |   .1435294
 pred. P |   .1189588  (at x-bar)
------------------------------------------------------------------------------
(*) dF/dx is for discrete change of dummy variable from 0 to 1
    z and P>|z| correspond to the test of the underlying coefficient being 0

. *exit;
. *******************************************************************************;
. * TABLE3 COMPARING DIRECT MEASURES OF CREDIT CONSTRAINTS WITH ASSET HOLDINGS;
. * at job loss;
. sum r_assrat, de;

                          r_assrat
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               1,785
25%            0              0       Sum of Wgt.       1,785

50%     .5357143                      Mean           4.364954
                        Largest       Std. Dev.      10.59134
75%     4.090909       74.16666
90%     11.95062            100       Variance       112.1764
95%      20.6852            150       Skewness       6.360635
99%     52.27273       171.4286       Kurtosis       69.19973

. gen rzeldes=(r_assrat<2);

. replace rzeldes=. if r_assrat==.;
(508 real changes made, 508 to missing)

. replace rzeldes=1 if ranyass==0;
(78 real changes made)

. gen r_noass=1-ranyass;
(358 missing values generated)

. *current;
. replace amtasst1=0 if anyasst1==0;
(0 real changes made)

. gen assrat1=amtasst1/rhhinc;
(372 missing values generated)

. gen zeldes=(assrat1<2);

. replace zeldes=. if assrat1==.;
(372 real changes made, 372 to missing)

. replace zeldes=1 if anyasst1==0;
(104 real changes made)

. gen noass=1-anyasst1;
(20 missing values generated)

. * check item nonresponse;
. sum r_noass rzeldes unsucc1 unsucc2 noass zeldes cantbrrw constr ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     r_noass |      1,935    .4310078    .4953452          0          1
     rzeldes |      1,863    .6489533    .4774257          0          1
     unsucc1 |      2,293    .0566943     .231308          0          1
     unsucc2 |      2,293    .1399913    .3470537          0          1
       noass |      2,273    .4975803    .5001042          0          1
-------------+---------------------------------------------------------
      zeldes |      2,025    .6844444    .4648515          0          1
   cantbrrw1 |      2,293    .2590493    .4382083          0          1
   constrnd1 |      2,293    .0335805    .1801859          0          1

. * generate a variable that marks the sample for which all these variables are nonmissing;
. quietly reg W2RESP r_noass rzeldes unsucc1 unsucc2 noass zeldes cantbrrw constr ;

. gen sample=0;

. replace sample=1 if e(sample)==1;
(1,863 real changes made)

. sum r_noass rzeldes unsucc1 unsucc2 noass zeldes cantbrrw constr if sample==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     r_noass |      1,863    .4476651     .497387          0          1
     rzeldes |      1,863    .6489533    .4774257          0          1
     unsucc1 |      1,863    .0617284    .2407262          0          1
     unsucc2 |      1,863    .1481481    .3553422          0          1
       noass |      1,863    .5668277     .495647          0          1
-------------+---------------------------------------------------------
      zeldes |      1,863    .6967257    .4597961          0          1
   cantbrrw1 |      1,863    .2742888     .446275          0          1
   constrnd1 |      1,863    .0402576    .1966157          0          1

. * note that rzeldes refers to at the job loss, and zeldes refers to at interview 1. similarly for ra
> nyass and anyass;
. * we compare the cant borrow and cnstr variables to interview 1 assets (because they refer to the cu
> rrent state);
. * we compare the SCF type questions (unsucc1 unsucc2) to asset at job loss, as they refer to the int
> erval between jobloss and interview 1;
. * Kappa statistic. Note that Kappa =1 for perfect agreement, = 0 for agreement that would arise "by 
> chance" and <0 for less than chance agreement;
. * Row1;
. kap noass cantbrrw if sample==1, tab ;

           |       cantbrrw1
     noass |         0          1 |     Total
-----------+----------------------+----------
         0 |       683        124 |       807 
         1 |       669        387 |     1,056 
-----------+----------------------+----------
     Total |     1,352        511 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  57.43%      46.98%     0.1971     0.0193      10.20      0.0000

. * Row2;
. kap noass constr if sample==1,tab;

           |       constrnd1
     noass |         0          1 |     Total
-----------+----------------------+----------
         0 |       802          5 |       807 
         1 |       986         70 |     1,056 
-----------+----------------------+----------
     Total |     1,788         75 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  46.81%      43.86%     0.0526     0.0080       6.54      0.0000

. * Row3;
. kap r_noass unsucc1 if sample==1,tab;

           |        unsucc1
   r_noass |         0          1 |     Total
-----------+----------------------+----------
         0 |       979         50 |     1,029 
         1 |       769         65 |       834 
-----------+----------------------+----------
     Total |     1,748        115 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  56.04%      54.59%     0.0320     0.0122       2.62      0.0044

. * Row 4;
. kap r_noass unsucc2 if sample==1,tab;

           |        unsucc2
   r_noass |         0          1 |     Total
-----------+----------------------+----------
         0 |       908        121 |     1,029 
         1 |       679        155 |       834 
-----------+----------------------+----------
     Total |     1,587        276 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  57.06%      53.68%     0.0729     0.0177       4.12      0.0000

.  * Row 5;
. kap zeldes cantbrrw if sample==1, tab ;

           |       cantbrrw1
    zeldes |         0          1 |     Total
-----------+----------------------+----------
         0 |       490         75 |       565 
         1 |       862        436 |     1,298 
-----------+----------------------+----------
     Total |     1,352        511 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  49.70%      41.12%     0.1458     0.0161       9.03      0.0000

. * Row 6;
. kap zeldes constr if sample==1,tab;

           |       constrnd1
    zeldes |         0          1 |     Total
-----------+----------------------+----------
         0 |       564          1 |       565 
         1 |     1,224         74 |     1,298 
-----------+----------------------+----------
     Total |     1,788         75 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  34.25%      31.91%     0.0343     0.0061       5.58      0.0000

. * Row 7;
. kap rzeldes unsucc1 if sample==1,tab;

           |        unsucc1
   rzeldes |         0          1 |     Total
-----------+----------------------+----------
         0 |       632         22 |       654 
         1 |     1,116         93 |     1,209 
-----------+----------------------+----------
     Total |     1,748        115 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  38.92%      36.94%     0.0313     0.0084       3.71      0.0001

. * Row 8;
. kap rzeldes unsucc2 if sample==1,tab;

           |        unsucc2
   rzeldes |         0          1 |     Total
-----------+----------------------+----------
         0 |       598         56 |       654 
         1 |       989        220 |     1,209 
-----------+----------------------+----------
     Total |     1,587        276 |     1,863 

             Expected
Agreement   Agreement     Kappa   Std. Err.         Z      Prob>Z
-----------------------------------------------------------------
  43.91%      39.52%     0.0726     0.0130       5.59      0.0000

.  *exit;
. *****************************************************************************;
. * Consumption Growth/ Excess Sensitivity;
. * consumption growth rate (int1 to int2);
. gen dlnx =ln(cxtot2/cxtot1);
(181 missing values generated)

. * adjusting consumption growth for elapsed time;
. *c=c0e^rt --> lnc-lnc0=rt --> (lnc-lnc0)/t = r;
. gen t=(welapsd2-welapsd1)/52;

. sum t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
           t |      2,293     .423029    .0631009   .2637376   .5576923

. replace dlnx=dlnx/t;
(1,837 real changes made)

. * trim outliers in growth rates;
. cumul dlnx, gen(fx);

. replace dlnx=. if fx>=.99|fx<=.01;
(43 real changes made, 43 to missing)

.  drop fx;

. * lagged income level (int 1);
. replace chhinc1=cpinc1 if (chhinc1==.&chhsize1==1);
(1 real change made)

. replace chhinc2=cpinc2 if (chhinc2==.&chhsize2==1);
(0 real changes made)

. gen lny=ln(chhinc1);
(203 missing values generated)

. gen dlny=ln(chhinc2/chhinc1);
(369 missing values generated)

. *  change in household size;
. gen dlhhsize=ln(chhsize2/chhsize1);
(4 missing values generated)

. sum dlnx  lny dlhhsize constrnd1 cantb age;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        dlnx |      2,069    .0158459    .9201776  -2.855704   2.962286
         lny |      2,090    7.577003    .6092047   3.912023    9.20984
    dlhhsize |      2,289    .0345781    .2645325  -1.609438   2.302585
   constrnd1 |      2,293    .0335805    .1801859          0          1
   cantbrrw1 |      2,293    .2590493    .4382083          0          1
-------------+---------------------------------------------------------
         age |      2,293   -.0746184    .7929727       -1.4        1.5

. gen unconst=1-constr;

. gen canb=1-cantb;

. gen age2=age^2;

. * change in employment;
. gen demp=cempl2-cempl1;
(81 missing values generated)

. drop if lny==.;
(203 observations deleted)

. drop if dlnx==.;
(161 observations deleted)

. egen mlny=mean(lny);

. replace lny=lny-mlny;
(1,929 real changes made)

. * TABLE 4: CONSUMPTION GROWTH
> 
> * COLUMN 1;
. reg dlnx age  dlhhsize  cantb constrnd1 anyasst1, rob;

Linear regression                               Number of obs     =      1,916
                                                F(5, 1910)        =       6.00
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0177
                                                Root MSE          =     .89459

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.0984423   .0272928    -3.61   0.000    -.1519692   -.0449154
    dlhhsize |   .3104947   .1003698     3.09   0.002     .1136488    .5073407
   cantbrrw1 |  -.0227872   .0469603    -0.49   0.628     -.114886    .0693116
   constrnd1 |   .2478204   .1000599     2.48   0.013     .0515822    .4440586
    anyasst1 |   .0494393   .0430829     1.15   0.251    -.0350551    .1339337
       _cons |   -.023442   .0346389    -0.68   0.499    -.0913761    .0444921
------------------------------------------------------------------------------

. * COLUMN 2;
. reg dlnx age  dlhhsize cantb constrnd1 anyasst1 demp  , rob;

Linear regression                               Number of obs     =      1,855
                                                F(6, 1848)        =       5.80
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0201
                                                Root MSE          =     .89656

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1026056   .0278625    -3.68   0.000     -.157251   -.0479602
    dlhhsize |   .3012609   .1023829     2.94   0.003     .1004625    .5020593
   cantbrrw1 |  -.0335374   .0479855    -0.70   0.485    -.1276489     .060574
   constrnd1 |   .2709375   .1029195     2.63   0.009     .0690869    .4727881
    anyasst1 |   .0431484    .044019     0.98   0.327    -.0431837    .1294805
        demp |   .0771082   .0413451     1.86   0.062    -.0039797    .1581962
       _cons |  -.0149037   .0353836    -0.42   0.674    -.0842997    .0544923
------------------------------------------------------------------------------

. * TABLE 5: CONSUMPTION GROWTH WITHIN GROUPS (and excess sensitivity tests);
. * COLUMN 1;
. reg dlnx age  dlhhsize lny, rob;

Linear regression                               Number of obs     =      1,926
                                                F(3, 1922)        =       9.18
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0177
                                                Root MSE          =      .8958

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1027517   .0270635    -3.80   0.000    -.1558286   -.0496748
    dlhhsize |   .2922129   .1003756     2.91   0.004     .0953563    .4890694
         lny |  -.0714392   .0365418    -1.95   0.051     -.143105    .0002266
       _cons |   .0041687   .0207817     0.20   0.841    -.0365883    .0449258
------------------------------------------------------------------------------

. * COLUMN 2;
. reg dlnx age  dlhhsize lny if constr==0, rob;

Linear regression                               Number of obs     =      1,854
                                                F(3, 1850)        =       7.87
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0156
                                                Root MSE          =     .89946

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.0963955   .0275598    -3.50   0.000     -.150447    -.042344
    dlhhsize |   .2802635   .1068348     2.62   0.009     .0707341    .4897929
         lny |  -.0697475   .0374959    -1.86   0.063    -.1432863    .0037913
       _cons |  -.0019771   .0212761    -0.09   0.926    -.0437048    .0397505
------------------------------------------------------------------------------

. * COLUMN 3;
. reg dlnx age  dlhhsize lny if cantb==0, rob;

Linear regression                               Number of obs     =      1,419
                                                F(3, 1415)        =       7.53
                                                Prob > F          =     0.0001
                                                R-squared         =     0.0181
                                                Root MSE          =     .92863

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1000505   .0318125    -3.15   0.002    -.1624553   -.0376458
    dlhhsize |   .3472611   .1226855     2.83   0.005     .1065961     .587926
         lny |  -.0777395   .0436571    -1.78   0.075     -.163379       .0079
       _cons |   .0087837   .0253287     0.35   0.729    -.0409021    .0584695
------------------------------------------------------------------------------

. * COLUMN 4;
. reg dlnx age  dlhhsize demp lny, rob;

Linear regression                               Number of obs     =      1,865
                                                F(4, 1860)        =       7.66
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0193
                                                Root MSE          =     .89812

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1084991   .0276297    -3.93   0.000    -.1626876   -.0543106
    dlhhsize |   .2844692   .1027088     2.77   0.006     .0830324    .4859059
        demp |   .0644962   .0412697     1.56   0.118    -.0164436    .1454359
         lny |  -.0645236   .0380215    -1.70   0.090    -.1390929    .0100457
       _cons |   .0078529   .0211803     0.37   0.711    -.0336867    .0493925
------------------------------------------------------------------------------

. * COLUMN 5;
. reg dlnx age  dlhhsize demp lny if constr==0, rob;

Linear regression                               Number of obs     =      1,798
                                                F(4, 1793)        =       6.44
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0166
                                                Root MSE          =     .90179

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1008788   .0281395    -3.58   0.000    -.1560685   -.0456891
    dlhhsize |   .2619412   .1094751     2.39   0.017      .047229    .4766535
        demp |   .0687628   .0426313     1.61   0.107    -.0148495    .1523751
         lny |  -.0594472   .0390438    -1.52   0.128    -.1360233    .0171289
       _cons |   .0015841   .0216829     0.07   0.942    -.0409424    .0441105
------------------------------------------------------------------------------

. * COLUMN 6;
. reg dlnx age  dlhhsize demp lny if cantb==0, rob;

Linear regression                               Number of obs     =      1,375
                                                F(4, 1370)        =       5.41
                                                Prob > F          =     0.0003
                                                R-squared         =     0.0175
                                                Root MSE          =      .9323

------------------------------------------------------------------------------
             |               Robust
        dlnx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1044451   .0325643    -3.21   0.001    -.1683264   -.0405639
    dlhhsize |   .3173664   .1265703     2.51   0.012     .0690738    .5656589
        demp |   .0486633   .0512835     0.95   0.343    -.0519395    .1492661
         lny |  -.0692758   .0454474    -1.52   0.128    -.1584298    .0198781
       _cons |    .014543   .0258654     0.56   0.574    -.0361971    .0652831
------------------------------------------------------------------------------

. *****************************************************************************;
. *TABLE 6 - FINANCIAL HARDSHIP ON JOB LOSS;
. gen brrw_cat=.;
(1,929 missing values generated)

. replace brrw_cat=0 if applied==0&discouraged==0;
(1,259 real changes made)

. replace brrw_cat=1 if applied==1&unsucc1==0;
(377 real changes made)

. replace brrw_cat=2 if applied==1&unsucc1==1;
(114 real changes made)

. replace brrw_cat=3 if discouraged==1;
(160 real changes made)

. label define brrw_cat 0 "no demand" 1 "successful applicant" 2 "unsuccessful applicant" 3 "discourag
> ed";

. label values brrw_cat brrw_cat;

. tab brrw_cat, gen(bcat);

              brrw_cat |      Freq.     Percent        Cum.
-----------------------+-----------------------------------
             no demand |      1,259       65.92       65.92
  successful applicant |        377       19.74       85.65
unsuccessful applicant |        114        5.97       91.62
           discouraged |        160        8.38      100.00
-----------------------+-----------------------------------
                 Total |      1,910      100.00

. rename bcat2 success;

. rename bcat3 unsucc;

. rename bcat4 dscrgd;

. * COLUMN 3 (FULL CONTROLS) NOTE that only last three coefficients appear in table;
. dprobit hrdshp1 $base $extra  success unsucc dscrgd;

Iteration 0:   log likelihood = -1012.5361
Iteration 1:   log likelihood = -932.79327
Iteration 2:   log likelihood = -931.83136
Iteration 3:   log likelihood = -931.83044

Probit regression, reporting marginal effects           Number of obs =   1479
                                                        LR chi2(19)   = 161.41
                                                        Prob > chi2   = 0.0000
Log likelihood = -931.83044                             Pseudo R2     = 0.0797

------------------------------------------------------------------------------
 hrdshp1 |      dF/dx   Std. Err.      z    P>|z|     x-bar  [    95% C.I.   ]
---------+--------------------------------------------------------------------
    male*|  -.0650059   .0317421    -2.03   0.043   .727519  -.127219 -.002792
     age |   .0494306   .0267062     1.85   0.064  -.120216  -.002913  .101774
   age45 |  -.0640796   .0864597    -0.74   0.459    .11048  -.233538  .105378
     hgh*|  -.0125961   .0314296    -0.40   0.688   .433401  -.074197  .049005
  unicol*|   .0377807   .0370427     1.01   0.311   .236646  -.034822  .110383
cspouse1*|  -.0750362   .0416425    -1.78   0.075    .71332  -.156654  .006582
     dch*|   .0710925   .0315813     2.25   0.025   .551724   .009194  .132991
 vismin1*|   .0098882   .0336536     0.29   0.769   .203516  -.056072  .075848
    quit*|  -.2236693    .059397    -3.60   0.000    .05071  -.340085 -.107253
    fire*|   .2152374   .0730575     2.48   0.013   .026369   .072047  .358428
     ill*|   .1347649   .0557354     2.26   0.024   .055443   .025525  .244004
ownhome1*|  -.1097034   .0412106    -2.63   0.009     .6119  -.190475 -.028932
mrtgage1*|   .0954818   .0376144     2.52   0.012   .439486   .021759  .169205
rsp_emp1*|  -.1017411   .0332451    -3.05   0.002   .448952    -.1669 -.036582
 ranyass*|  -.0367085   .0282321    -1.30   0.195   .584855  -.092042  .018625
 ranydeb*|   .1223455   .0282727     4.32   0.000   .636917   .066932  .177759
 success*|   .0292903   .0338692     0.86   0.390   .198107  -.037092  .095673
  unsucc*|   .1903151    .050207     3.36   0.001   .061528   .091911  .288719
  dscrgd*|   .2416264   .0417263     4.85   0.000    .08384   .159844  .323408
---------+--------------------------------------------------------------------
  obs. P |   .5652468
 pred. P |    .573852  (at x-bar)
------------------------------------------------------------------------------
(*) dF/dx is for discrete change of dummy variable from 0 to 1
    z and P>|z| correspond to the test of the underlying coefficient being 0

. gen complete=e(sample)==1;

. * COLUMN 2 (NO CONTROLS BUT SAME SAMPLE);
. dprobit hrdshp1 success unsucc dscrgd if complete==1;

Iteration 0:   log likelihood = -1012.5361
Iteration 1:   log likelihood = -985.00728
Iteration 2:   log likelihood = -984.82718
Iteration 3:   log likelihood = -984.82715

Probit regression, reporting marginal effects           Number of obs =   1479
                                                        LR chi2(3)    =  55.42
                                                        Prob > chi2   = 0.0000
Log likelihood = -984.82715                             Pseudo R2     = 0.0274

------------------------------------------------------------------------------
 hrdshp1 |      dF/dx   Std. Err.      z    P>|z|     x-bar  [    95% C.I.   ]
---------+--------------------------------------------------------------------
 success*|   .0366632   .0325172     1.12   0.263   .198107  -.027069  .100396
  unsucc*|   .2309358   .0446122     4.37   0.000   .061528   .143498  .318374
  dscrgd*|    .279745   .0367413     6.04   0.000    .08384   .207733  .351757
---------+--------------------------------------------------------------------
  obs. P |   .5652468
 pred. P |   .5694787  (at x-bar)
------------------------------------------------------------------------------
(*) dF/dx is for discrete change of dummy variable from 0 to 1
    z and P>|z| correspond to the test of the underlying coefficient being 0

. * COLUMN 1 (RAW PROPORTION, SAME SAMPLE);
. tab brrw_cat hrdshp1 if complete==1, row;

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

                      |       QJ43    
             brrw_cat |         0          1 |     Total
----------------------+----------------------+----------
            no demand |       467        504 |       971 
                      |     48.09      51.91 |    100.00 
----------------------+----------------------+----------
 successful applicant |       130        163 |       293 
                      |     44.37      55.63 |    100.00 
----------------------+----------------------+----------
unsuccessful applican |        22         69 |        91 
                      |     24.18      75.82 |    100.00 
----------------------+----------------------+----------
          discouraged |        24        100 |       124 
                      |     19.35      80.65 |    100.00 
----------------------+----------------------+----------
                Total |       643        836 |     1,479 
                      |     43.48      56.52 |    100.00 


. *****************************************************************************;
. log close;
      name:  <unnamed>
       log:  /Users/thomascrossley/Dropbox/complete 2014/cl - are the unemployed credit constrainted/s
> tata/archive prep/PUMF/cl_credit.log
  log type:  text
 closed on:  26 Jun 2015, 11:42:46
------------------------------------------------------------------------------------------------------
